/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Server.domain.items;

import Server.domain.GameLevel;
import Server.domain.Player;
import java.util.ArrayList;
import java.util.List;

/**
 *
 * @author Ripper
 */
public abstract class Weapon extends Equipment
{
    private int physicalAttackValue;
    private boolean twoHandedWeapon;
    
    public Weapon(String itemName, int itemCost, int looktype, int attackValue, int defenseValue, int magicArmorValue, boolean twoHanded, List<ItemAttribute> attributes)
    {
        super(itemName, itemCost, looktype, defenseValue, magicArmorValue, attributes);
        
        setPhysicalAttackValue(attackValue);
        setTwoHandedWeapon(twoHanded);
    }
    
    public void attack(GameLevel gl, Player parent)
    {
        gl.playerAttacks(parent);
        specificAttack(gl, parent);
        gl.playerDoneAttacking();
    }
    public abstract void specificAttack(GameLevel gl, Player parent);

    public int getPhysicalAttackValue() { return physicalAttackValue; }
    public final void setPhysicalAttackValue(int physicalAttackValue) { this.physicalAttackValue = physicalAttackValue; }
    public boolean isTwoHandedWeapon() { return twoHandedWeapon; }
    public final void setTwoHandedWeapon(boolean twoHandedWeapon) { this.twoHandedWeapon = twoHandedWeapon; }
    public abstract Item copyItem();
    @Override
    public String getItemType()
    {
        return "weapon";
    }    
    @Override
    public String getItemAttributes()
    {
        String data = super.getItemAttributes();
        
        data = "Physical Attack: " + getPhysicalAttackValue() + ", " + 
               "Two handed: " + isTwoHandedWeapon() + ", " + data;
        
        return data;
    }
}
